package com.example.learnspringboot05web;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;

import java.util.Locale;

/*
    https://www.webjars.org/

    搜索 WebMvcAutoConfiguration 看源码

    spring-boot-starter-thymeleaf
    https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.build-systems.starters
    https://github.com/thymeleaf/thymeleaf

    Thymeleaf介绍
    https://blog.csdn.net/chinus_yan/article/details/121718774

    Thymeleaf 实战
    https://blog.csdn.net/SoulNone/article/details/127572997

    spring中stereotype注解Component，Repository，Service，Controller
    https://blog.csdn.net/PacosonSWJTU/article/details/120847403

    Spring 注解开发下的依赖注入
    https://blog.csdn.net/qq_51272114/article/details/127334759
 */
@SpringBootApplication
public class LearnSpringBoot05WebApplication {

    public static void main(String[] args) {
        SpringApplication.run(LearnSpringBoot05WebApplication.class, args);
    }

    /*
       查看 DispatcherServlet 里的 doDispatch 方法
     */
    @Bean
    public ViewResolver myViewResolver(){
        return new MyViewResolver();
    }

    private static class MyViewResolver implements ViewResolver{

        @Override
        public View resolveViewName(String viewName, Locale locale) throws Exception {
            return null;
        }
    }

}
